package com.linln.admin.pcs.service;

import com.baidu.unbiz.fluentvalidator.Result;
import com.linln.common.data.PageSort;
import com.linln.common.utils.HttpServletUtil;
import com.linln.common.utils.ResultVoUtil;
import com.linln.component.shiro.ShiroUtil;
import com.linln.modules.system.domain.User;
import com.linln.modules.system.domain.VerifyLog;
import com.linln.modules.system.repository.BaseRepository;
import com.linln.modules.system.repository.VerifyLogRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.view.ThymeleafViewResolver;

import javax.persistence.EntityManager;
import java.io.Serializable;
import java.io.StringWriter;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;

@Service
public class VerifyLogService {
    @Autowired
    private VerifyLogRepository verifyLogRepository;
    //插入审核日志
    public void setVerifyLog(Long cid,Integer verifyStatus,Integer type,String remark){
        VerifyLog verifyLog = new VerifyLog();
        verifyLog.setCid(cid);
        verifyLog.setVerifyStatus(verifyStatus);
        verifyLog.setRemark(remark);
        User user = ShiroUtil.getSubject();
        verifyLog.setCreateUser(user.getId());
        verifyLog.setType(type);
        verifyLogRepository.save(verifyLog);

    }
}
